home *** CD-ROM | disk | FTP | other *** search
- # include "Shell.h"
-
- extern Rect gDeskRect;
- extern MenuHandle gShellMenuHandles[];
-
- /*-------------------------------------------------------------------------
- initshell() Inits all the application-specific variables...
- -------------------------------------------------------------------------*/
-
- initshell()
- {
- MenuHandle mhndl;
- Rect temprect;
- short err, cnt;
- unsigned long seed;
-
- /* Get Bounding box of Desktop */
- gDeskRect = (**GetGrayRgn()).rgnBBox;
-
- /* Reset random number generator */
- GetDateTime(&seed);
- randSeed = seed;
-
- /* Read in menus, draw the bar... */
- mhndl = GetMenu(kAppleMenuID);
- if(mhndl == nil)
- BailOut();
- AddResMenu(mhndl, 'DRVR');
- InsertMenu(mhndl, 0);
- (*mhndl)->menuID = kAppleMenuID;
- gShellMenuHandles[kAppleMenu] = mhndl;
-
- mhndl = GetMenu(kFileMenuID);
- if(mhndl == nil)
- BailOut();
- InsertMenu(mhndl, 0);
- (*mhndl)->menuID = kFileMenuID;
- gShellMenuHandles[kFileMenu] = mhndl;
-
- mhndl = GetMenu(kEditMenuID);
- if(mhndl == nil)
- BailOut();
- InsertMenu(mhndl, 0);
- (*mhndl)->menuID = kEditMenuID;
- gShellMenuHandles[kEditMenu] = mhndl;
-
- DrawMenuBar();
-
- /* Init the App's stuff */
- if(!AppInit())
- BailOut();
- }
-
-